package com.sec.android.app.myfiles.module.optimizestorage;

import com.sec.android.app.myfiles.provider.DbTableInfo;

/**
 * Created by daesu83.kim on 2016-10-07.
 */

public class OptimizeStorageDbTableInfo extends DbTableInfo {

    public static final String QUERY_PARAM_OPTIMIZE_STORAGE_TYPE = "optimizeStorageType";
    public static final String QUERY_PARAM_REFRESH = "refresh";
    public static final String QUERY_PARAM_IS_FILTER_ALL = "isFilterAll";
    public static final String EXTRAS_KEY_TOTAL_SIZE = "totalSize";
    public static final String EXTRAS_KEY_GROUP_CHILD_COUNT = "groupChildCount";
    public static final String EXTRAS_KEY_GROUP_NAME = "groupName";
    public static final String EXTRAS_KEY_DUPLICATED_FILES_FILE_SIZE = "fileSize";
    public static final String COLUMN_NAME_FILE_ID = "source_media_id";
    public static final String COLUMN_NAME_PARENT_ID = "parent_cloud_id";

    private static OptimizeStorageDbTableInfo sInstance;

    public static DbTableInfo getInstance() {
        if (sInstance == null) {
            sInstance = new OptimizeStorageDbTableInfo();
        }
        return sInstance;
    }

    private OptimizeStorageDbTableInfo() {
        mTableColumn.add(new DB_Column(COLUMN_ID.ID, "_id", "integer PRIMARY KEY AUTOINCREMENT"));
        mTableColumn.add(new DB_Column(COLUMN_ID.MEDIA_ID, "media_id", "integer"));
        mTableColumn.add(new DB_Column(COLUMN_ID.STORAGE_TYPE, "storage_type", "text"));
        mTableColumn.add(new DB_Column(COLUMN_ID.OPTIMIZE_TYPE, "optimize_type", "text"));
        mTableColumn.add(new DB_Column(COLUMN_ID.PATH, "path", "text"));
        mTableColumn.add(new DB_Column(COLUMN_ID.NAME, "name", "text"));
        mTableColumn.add(new DB_Column(COLUMN_ID.SIZE, "size", "integer"));
        mTableColumn.add(new DB_Column(COLUMN_ID.DATE, "date", "integer"));
        mTableColumn.add(new DB_Column(COLUMN_ID.FILE_TYPE, "file_type", "integer"));
        mTableColumn.add(new DB_Column(COLUMN_ID.EXT, "ext", "text"));
        mTableColumn.add(new DB_Column(COLUMN_ID.FILE_ID, COLUMN_NAME_FILE_ID, "text"));
        mTableColumn.add(new DB_Column(COLUMN_ID.PARENT_CLOUD_ID, COLUMN_NAME_PARENT_ID, "text"));
        mTableColumn.add(new DB_Column(COLUMN_ID.SUB_GROUP_ID, "sub_group_id", "integer"));
        mTableColumn.add(new DB_Column(COLUMN_ID.DEVICE_ID, "device_id", "integer"));
        mTableColumn.add(new DB_Column(COLUMN_ID.DATE_ACCESSED, "date_accessed", "integer"));
    }

    @Override
    public String getTableName() {
        return "optimize_storage";
    }

    @Override
    public boolean isRealDb() {
        return true;
    }
}
